import axios from './axios.js'

// 查询列表
export function listGoods(query) {
  return axios.request({
    url: 'api/web/goods/list',
    method: 'get',
    params: query
  })
}

// 查询详细
export function getGoods(goodsId) {
  return axios.request({
    url: 'api/web/goods/' + goodsId,
    method: 'get'
  })
}

// 新增
export function addGoods(data) {
  return axios.request({
    url: 'api/web/goods',
    method: 'post',
    data: data
  })
}

// 修改
export function updateGoods(data) {
  return axios.request({
    url: 'api/web/goods',
    method: 'put',
    data: data
  })
}

// 删除
export function delGoods(goodsId) {
  return axios.request({
    url: 'api/web/goods/' + goodsId,
    method: 'delete'
  })
}

